const fp = require('lodash/fp')
const { Maybe } = require('./support')

const mayBe = Maybe.of([5, 6, 1])

/**
 *
 * @param {Maybe} container Maybe函子
 * @param {number} [addend=1] 需要增加的数
 */
const ex1 = (container, addend = 1) => {
  const itemAdd = fp.map(fp.add(addend))
  return container.map(itemAdd)
}

console.log('增加的数为1,执行ex1后', ex1(mayBe))
console.log('增加的数为2,执行ex1后', ex1(mayBe, 2))
